﻿{include file='../Common/shake-header.html'}
	<body class="index-bg3">
	<div style="height:40px"></div>	
	<a href="index.php?g=home&m=shake&a=index"><img src="{$_C.hy_path}images/plus/home.png" class="home"></a>	
	<div class="fs1 tx-c">
		完善个人资料
	</div>
	<div style="height:15px"></div>
	<p class="tx-c" style="width:180px;margin:0 auto;line-height:16px">
	{if $info.phone ==""}
	请您认真填写以下信息，以便我们与您联系并发放奖品
	{else}
	你已成功提交过信息，请留意游戏的最新排名
	{/if}
	</p>
	<div style="height:45px"></div>	
	
	<div class="person-list">
		<span>收货地址</span>
			{if $info.phone !=""}
	
	<input name="address" type="text" maxlength="50" id="address" value="{$info.address}"  disabled=true    >
	
	{else}
	<input name="address" type="text" maxlength="50" id="address" value=""      >
	
	{/if}
	</div>

	<div class="person-list">
		<span >姓名</span>
		{if $info.phone !=""}
	
	<input name="name" type="text" maxlength="50" id="name" value="{$info.pname}"  disabled=true    >
	
	{else}
	<input name="name" type="text" maxlength="50" id="name" value=""      >
	
	{/if}
	</div>

	<div class="person-list">
		<span>电话</span>
		{if $info.phone !=""}
	
	<input name="phone" type="text" maxlength="50" id="phone" value="{$info.phone}"  disabled=true    >
	
	{else}
	<input name="phone" type="text" maxlength="50" id="phone" value=""      >
	
	{/if}
	</div>

	<div class="button-list">
	<div style="height:30px"></div>
{if $info.phone ==""}
	<div class="button-bg"  onClick="check()" >提&nbsp;&nbsp;交</div>
	{/if}
	</div>
	
<div class="alert" id="alert2" style="padding:15px">
		
			<div id="msg" class="fs3"></div>
			
			
			<a href="javascript:void(0)" class="alert-btn fc1 fs3">确定</a>
			
		</div>
	</body>
	<script type="text/javascript" src="{$_C.hy_path}js/jquery-1.3.2.js">	</script>
	<script>
	
	var rank = "{$rank}";
	var prize = "{$info.prize}";
						$(document).ready(function () {
			
			
			


			
			$('a.alert-btn').click(function (e) {
		$('div.alert').hide();
	});
	
		});
	
	
		function showMsg(msg)
	{
		$("#msg").text(msg);
					$('div#alert2').show();
	}
	
	if(prize>0)
	{
		showMsg("你已成功提交过信息，请留意游戏的最新排名");
	}
	
			function check()
			{
				var url = "index.php?g=home&m=shake&a=submitInfo";
				
				var phone = $("#phone").val();
				var name = $("#name").val();
			var address = $("#address").val();
				 
				
//				if(!(rank > 0))
//				{
//					showMsg("未选择兑换奖品，无法提交信息。");
//					return;
//				}
				
				
				if(phone==""||name==""||address=="")
				{
					showMsg("请填写完整信息。");
					return;
				}
				
				
				if(phone.length!=11)
				{
					showMsg("请填写正确的11位电话号码。");
					return;
				}
				

				
				var data = {
				name:name,
				address:address,
				phone:phone,
				rank:rank
			
				};
				
				$.post(url,data,function(res){
					if(res=="ok")
					{
						showMsg("提交成功");
						setTimeout("window.location.href='index.php?g=home&m=shake&a=person';",1000);
						
					}
					else
					{
						showMsg(res);
					}
					
					//window.location.href="/index.php?g=home&m=plus&a=person";
				},"text");
			}
			
</script>

</html>


